/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trial.util;

import java.io.Serializable;

/**
 *
 * @author feifei
 */
public class Discount implements Serializable{
    private Long numberOfPeople;
    private Long discount;

    public Discount() {
    }
    public Discount(Long numberOfPeople) {
        this.numberOfPeople = numberOfPeople;
        discount=process(numberOfPeople);
    }

    public Long getDiscount() {
        return discount;
    }

    public Long getNumberOfPeople() {
        return numberOfPeople;
    }

    public void setDiscount(Long discount) {
        this.discount = discount;
    }

    public void setNumberOfPeople(Long numberOfPeople) {
        this.numberOfPeople = numberOfPeople;
    }
    
    
    
    private Long process(Long numberOfPeople)
    {
        if(numberOfPeople>10)
        return new Long(20);
        else if (numberOfPeople>4)
            return new Long(10);
             else
            return new Long(0);
    }
}
